<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script>
		// 窗口加载完再执行
		window.onload = function () {

			pp = document.getElementsByTagName('p');
			ss = document.getElementsByTagName('span');
			box = document.getElementsByClassName('box');
			xbs = document.getElementById('xbs');

			console.log(box);

			for (var i=0;i<box.length;i++) {
				box[i].style.color="red"
			}

			xbs.style.color="blue";

			console.log(xbs);
			console.log(box);

			console.log(pp[0]);

			ss[1].style.color="red"

			console.log();
		}
	</script>
</head>
<body>
	<p>学并思</p>
	<span>我是span1</span>
	<span>我是span2</span>
	<span>我是span3</span>
	<span>我是span4</span>
	<span>我是span5</span>
	<span>我是span6</span>
	<i id="xbs">这个是i</i>

	<b class="box">学并思</b>
	<b class="box">学并思</b>
	<b class="box">学并思</b>
	<b class="box">学并思</b>
	<b class="box">学并思</b>


</body>
</html>